<template>
    <h1>watchEffect的使用</h1>
    <div>
        姓名: <input type="text" v-model="person.name"><br>
        年龄：<input type="text" v-model="person.age"><br>
        职业:<input type="text" v-model="person.job"><br>
    </div>
</template>

<script>
import { reactive,watchEffect} from 'vue'
export default {
    setup(){
        let person=reactive({
            name:'Giles',
            age:33,
            job:'worker'
        })
        watchEffect(()=>{
            person.name
            person.age
            person.job
            console.log('------监听了------');
        })
        return{person}
    }
}
</script>

<style>

</style>